<?php
/**
 * Created by PhpStorm.
 * User: Vladimir
 * Date: 21.08.14
 * Time: 22:09
 * RBAC http://yiiframework.ru/doc/cookbook/ru/access.rbac.file
 */
return array(
    'guest' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Guest',
        'bizRule' => null,
        'data' => null
    ),
    'user' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'User',
        'children' => array(
            'guest', // унаследуемся от гостя
        ),
        'bizRule' => null,
        'data' => null
    ),
    'moderator' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Moderator',
        'children' => array(
            'manager',          // позволим модератору всё, что позволено пользователю
        ),
        'bizRule' => null,
        'data' => null
    ),
    'manager' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Manager',
        'children' => array(
            'agent',
            'seller',
            'worker',
        ),
        'bizRule' => null,
        'data' => null
    ),
    'worker' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Worker',
        'children' => array(
            'user',
        ),
        'bizRule' => null,
        'data' => null
    ),
    'agent' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Agent',
        'children' => array(
            'user',
            'seller',
        ),
        'bizRule' => null,
        'data' => null
    ),
    'seller' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Seller',
        'children' => array(
            'user',
        ),
        'bizRule' => null,
        'data' => null
    ),
    'admin' => array(
        'type' => CAuthItem::TYPE_ROLE,
        'description' => 'Administrator',
        'children' => array(
            'moderator',         // позволим админу всё, что позволено модератору
        ),
        'bizRule' => null,
        'data' => null
    ),
);